package com.qiguliuxing.dts.common.constant;

/**
 * redis key 常量
 * @author qiguliuxing
 */
public interface RedisKeyConsts {

    /**
     * 微信小程序端用户登录key
     */
    String WX_LOGIN_USER = "wx_login_user_{0}";

    /**
     * 首页缓存 key
     */
    String HOME_CACHE_INDEX = "home_cache_index";
    String HOME_CACHE_CATALOG = "home_cache_catalog";

    /**
     * 秒杀商品key配置，存储指定秒杀商品
     */
    String SECKILL_GOODS = "seckill_goods_{0}";

    /**
     * 存储指定货品信息
     */
    String GOODS_PRODUCT = "goods_product_{0}";

    /**
     * 存储可用的秒杀批次id集合
     */
    String AVAILABLE_BATCH_CONFIG_LIST = "available_batch_config_list";
    /**
     * 存储某个指定批次信息
     */
    String SECKILL_BATCH = "seckill_batch_{0}";

    /**
     * 秒杀货品 剩余数量
     */
    String REDIS_SECKILL_PRODUCT_LEFT = "seckill_product_left_{0}";

    /**
     * 指定秒杀商品是否已经结束标识
     */
    String REDIS_SECKILL_GOODS_FINISH_FLAG = "seckill_goods_finish_flag_{0}";
    /**
     * 秒杀操作的分布式锁前缀
     */
    String SECKILL_LOCK_KEY = "seckill_lock_key_";
    /**
     * 秒杀分布式锁的过期时间，单位秒
     */
    long LOCK_KEY_SECOND = 30L;

    /**
     * 用户秒杀商品的订单简要信息存储,可用于标识用户是否已经抢购过该秒杀商品
     */
    String REDIS_SECKILL_GOODS_USER_FLAG = "seckill_goods_{0}_user_{1}";

    /**
     * 存储秒杀商品下货品集合信息
     */
    String REDIS_SECKILL_GOODS_PRODUCT_IDS = "seckill_goods_product_ids_{0}";

    /**
     * 存储秒杀批次下可用商品的集合信息
     */
    String REDIS_SECKILL_BATCH_GOODS_IDS = "seckill_batch_goods_ids_{0}";

    /**
     * 用于存储待清理的用户秒杀订单句柄
     */
    String REDIS_SECKILL_GOODS_TO_CLEANED = "seckill_goods_to_cleaned_{0}";;
}
